<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>View User</title>
<script src="references/js/jquery-2.1.0.min.js">
</script>
<script>
function deleteAppAction(i){
	if (confirm("Delete ?")) {
		$.ajax({
	        type: "POST",
	        url: "/Struts_1.3_WebApp_FrameWork/deleteAppAction.jms",
	        data: {
	            appid: i
	        }
	        })
	    .done(function (msg) {
	           alert(msg);
	           getHotApp();
	        });
    }
}
</script>
</head>
<body>
	<tiles:insertTemplate template="/pages/masterpage/masterPage.jsp">
		<tiles:putAttribute name="body">

			

			

			<logic:equal name="roleCheck" value="2">
				<div class="col-xs-12"
					style="text-align: left">
					<div class="well profile" style="width:100%">
			<html:link action="/viewAllUser">		<button class="btn btn-default btn-xs">Back</button></html:link>
						<div class="col-sm-12">
							
							<div class="col-xs-12 col-sm-8">
								<h2>
									<bean:write name="userInfo" property="name" />
								</h2>
								<p>
									<strong>Username: </strong>
									<bean:write name="userInfo" property="username" />
								</p>
								<p>
									<strong>Email: </strong>
									<bean:write name="userInfo" property="email" />
								</p>
								
								<p>
									<strong>Balance: </strong> <span class="tags"> <bean:write
											name="userInfo" property="balance" /></span>
								</p>
							</div>
							<div class="col-xs-12 col-sm-4 text-center">
								<figure> 
								
								<img
									src="http://www.localcrimenews.com/wp-content/uploads/2013/07/default-user-icon-profile.png"
									alt="" class="img-circle img-responsive"> </figure>
							</div>
						</div>
						<div class="col-xs-12">
						<div id="downloadLink"></div>
						<div class="row" style="margin-top:10px">
							<ul class="nav nav-tabs">
								<li class="active"><a href="#down" data-toggle="tab">App Downloaded</a></li>
								
						
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div class="tab-pane active" id="down">App Downloaded..
									<div class="carousel-inner">
                <div class="item active">
                    <div id = "list-app-download-content">
                            
                            </div>
                            
                            </div></div>
								</div>
							
								
							</div>

						</div></div>
					</div>
				</div>
				
		<script>
function getUserDownloadApp(){
	$.ajax({
	    type: "POST",
	    url: "/Struts_1.3_WebApp_FrameWork/getUserDownloadApp.jms",
	    data: {
	    	usernameCheck: "${requestScope.userInfo.username}",
	    }
	    })
	.done(function (msg) {
		if(msg!=null){
			$('#list-app-download-content').html(msg);
	        $('ul.da-thumbs > li').hoverdir();
		}
	    });
	}
	$(document).ready(function(){
		getUserDownloadApp();
	});
</script>

			</logic:equal>


			<logic:equal name="roleCheck" value="1">

				<div class="col-xs-12"
					style="text-align: left">
					<div class="well profile"  style="width:100%">
				<html:link action="/viewAllUser">	<button class="btn btn-default btn-xs">Back</button></html:link>
						<div class="col-sm-12">
							<div class="col-xs-12 col-sm-8">
								<h2>
									<bean:write name="userInfo" property="name" />
								</h2>
								<p>
									<strong>Username: </strong>
									<bean:write name="userInfo" property="username" />
								</p>
								<p>
									<strong>Email: </strong>
									<bean:write name="userInfo" property="email" />
								</p>
								<p>
									<strong>Bank Account No: </strong>
									<bean:write name="userInfo" property="bankAccountNo" />
								</p>
								<p>
									<strong>Bank Account Name: </strong>
									<bean:write name="userInfo" property="bankAccountName" />
								</p>
								<p>
									<strong>Bank Name: </strong>
									<bean:write name="userInfo" property="bankName" />
								</p>
								<p>
									<strong>Paypal: </strong>
									<bean:write name="userInfo" property="paypal" />
								</p>
								<p>
									<strong>Balance: </strong> <span class="tags"> <bean:write
											name="userInfo" property="balance" /></span>
								</p>
							</div>
							<div class="col-xs-12 col-sm-4 text-center">
								<figure> <img
									src="http://www.localcrimenews.com/wp-content/uploads/2013/07/default-user-icon-profile.png"
									alt="" class="img-circle img-responsive"> </figure>
							</div>
						</div>
						<div class="col-xs-12">
						<div id="downloadLink"></div>
						<div class="row" style="margin-top:10px">
							<ul class="nav nav-tabs">
								<li class="active"><a href="#down" data-toggle="tab">App Downloaded</a></li>
								<li><a href="#up" data-toggle="tab">App Uploaded</a></li>
						
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div class="tab-pane active" id="down">App Downloaded..
									<div class="carousel-inner">
                <div class="item active">
                    <div id = "list-app-download-content">
                            
                            </div>
                            
                            </div></div>
								</div>
								<div class="tab-pane" id="up">
								App Uploaded...
									<div class="carousel-inner">
                <div class="item active">
                    <div id = "list-app-upload-content">
                            
                            </div>
                            
                            </div></div>
								</div>
								
							</div>

						</div>
						</div>
					</div>
				</div>
			
<script>
function getUserDownloadApp(){
	$.ajax({
	    type: "POST",
	    url: "/Struts_1.3_WebApp_FrameWork/getUserDownloadApp.jms",
	    data: {
	    	usernameCheck: "${requestScope.userInfo.username}",
	    }
	    })
	.done(function (msg) {
		
		if(msg!=null){
			$('#list-app-download-content').html(msg);
	        $('ul.da-thumbs > li').hoverdir();
		}
	    });
	}
function getUserUploadApp(){
	$.ajax({
	    type: "POST",
	    url: "/Struts_1.3_WebApp_FrameWork/getUserUploadApp.jms",
	    data: {
	    	usernameCheck: "${requestScope.userInfo.username}",
	    }
	    })
	.done(function (msg) {
		
		if(msg!=null){
			$('#list-app-upload-content').html(msg);
	        $('ul.da-thumbs > li').hoverdir();
		}
	    });
	}
	$(document).ready(function(){
		getUserDownloadApp();
		getUserUploadApp();
	});
</script>

			</logic:equal>

		</tiles:putAttribute>
	</tiles:insertTemplate>

</body>
</html>